import { StateCodeMessage } from "@/api/result";

//接口返回的状态码
export enum StateCode {
    SUCCESS = 200,
    ERROR_SYSTEM = 5000,
    ERROR_UNAUTHENTICATION = 5001,
    ERROR_TIMEOUT_REQUEST = 5002,
    ERROR_TIMEOUT_TOKEN = 5003,
    ERROR_INVALID_SIGN = 5004,
    ERROR_AUTHENTICATION_VALID = 5005,
    ERROR_NOT_PERMISSION = 5006,
    ERROR_LIMITED = 5007,
    ERROR_BUSINESS = 6000,
    ERROR_PARAMS = 6001,
    ERROR_REQUEST_PARAMS = 6002,
    ERROR_PARAMS_SERVICE = 6003,
    ERROR_DATA_FORMAT = 6004,
    ERROR_EXIST = 6005,
    ERROR_NOT_EXIST = 6006,
    ERROR_NOT_SUPPORT = 7000,
    ERROR_LIMIT_EXCEEDED = 7001,
    ERROR_MULTIPART = 7002,
}

//接口返回的状态码和提示信息
export const stateCodeMessage: StateCodeMessage = {
    200: '操作成功',
    5000: '系统异常',
    5001: '登陆授权异常',
    5002: '请求超时',
    5003: '无效令牌',
    5004: '无效签名',
    5005: '认证失败或令牌已过期',
    5006: '权限不足',
    5007: '操作受限',
    6000: '业务逻辑异常',
    6001: '参数校验错误',
    6002: '请求参数异常',
    6003: '参数逻辑校验错误',
    6004: '数据格式错误',
    6005: '数据已存在',
    6006: '数据不存在',
    7000: '不支持该文件类型',
    7001: '超出请求次数上限',
    7002: '文件上传异常',
};